@use "../common/helper" as *;

*,
*::before,
*::after {
  outline: none;
  box-sizing: border-box;
}

// @import "_webkit-scrollbar";

::selection {
  @include set-var-color(background-color, 'accent', 'lighter');
  @debug set-var-color(background-color, 'accent', 'lighter');
  background-color: getCssVar('accent', 'lighter');
}

body,
ol, ul, li,
h1, h2, h3, h4, h5, h6, p,
blockquote {
  margin: 0;
  padding: 0;
}

ol, ul, li {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-size: 100%;
  font-weight: normal;
}

p {
  line-height: 1.8;
  font-size: 100%;
}

b,
strong {
  font-weight: 600;
}

small {
  font-size: 80%;
}

pre,
code,
kbd,
samp {
  font-family: monospace monospace;
  font-size: inherit;
}

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
}

img {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
  border-style: none;
}

svg:not(:root) {
  overflow: hidden;
}

button,
input,
optgroup,
option,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
}

button,
select {
  text-transform: none;
}

textarea {
  overflow: auto;
  resize: vertical;
}

input,
textarea {
  color: getCssVar('text');
  font-weight: 500;
  caret-color: var(--accent);

  &::placeholder {
    opacity: 0.35;
  }
}

[contenteditable] {
  caret-color: var(--accent);
}

template,
[hidden] {
  display: none !important;
}

@import "./prism";
@import "./theme";

:root {
  --prism-font-size: 0.9rem;
  --prism-font-family: "Input Mono", "Courier New", sans-serif;
}

html {
  accent-color: var(--accent);
  tab-size: 4;
  scroll-behavior: smooth;
  font-variant-ligatures: common-ligatures;
  // -webkit-font-smoothing: antialiased;
  // -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  line-height: var(--leading-body);
  color: var(--fg);
  font-size: var(--text-body);
  font-weight: normal;
  font-family: var(--font-sans);
  text-align: left;
}

h1, h2, h3, h4, h5, h6, p {
  margin-bottom: 0.5em;
}

hr {
  width: 50px;
  height: 1px;
  margin: 2rem auto;
  border: 0;
  background-color: var(--divider);
  clear: both;
}

a {
  color: currentColor;
  text-decoration: none;

  &:focus,
  &:active {
    outline: 0;
  }
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

th {
  text-align: inherit;
}

blockquote {
  margin: 20px 0;
  padding: 0.75rem 1rem;
  // border: 1px solid var(--accent);
  // border-radius: 8px;
  // background-color: rgba(var(--accent-rgb), .1);

  > p:last-child {
    margin-bottom: 0;
  }
}

pre, textarea {
  -webkit-overflow-scrolling: touch;
}
